package com.zyf.EasyNet.app.config;

import com.zyf.EasyNet.app.interceptor.UserInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @first_author zyflzz
 * @gmt_created 2022/4/19
 * @gmt_modified 2022/4/19
 */

/**
 * 这个类设置 url 拦截
 */
public class AppConfigurer implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(new UserInterceptor())
                .addPathPatterns("/login")
                .addPathPatterns("/signup")
                .addPathPatterns("/data")
                .addPathPatterns("/simulation")
                .addPathPatterns("/homePage");
    }
}
